package com.gis3c.sys.service;

import com.gis3c.sys.entry.po.Token;
import com.gis3c.sys.entry.po.User;
import com.gis3c.sys.entry.vo.UserModel;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface UserService {
    public UserModel createUser(UserModel userModel);
    public int deleteUsers(String[] userIds);
    public void changePassword(String userId, String newPassword);

    public List<UserModel> allUsers();
    public List<UserModel> allUsersByPage(int pagesize,int currentpage);
    public Integer allUsersCount();

    public UserModel findUserByUsername(String username);
    public User findByUsername(String username);
    public UserModel findByUserId(String userId);

    public int userCount(String username);

    public void correlationOrg(String userId, String orgId);
    public void uncorrelationOrg(String userId);
    public List<UserModel> findUsersByOrgId(String orgId);
    public List<UserModel> findUsersByOrgId(String orgId,int pagesize,int currentpage);
    public Integer usersCountByOrgId(String orgId);

    public Set<String> findPermissions(String username);

    public Token findTokenByUserId(String userId);
    public List<Map<String,Object>> getUserWithToken(String userId);
    public String getUserNameByToken(String token);
    public String getTokenByUserName(String userName);
    public String findsecretByUserName(String userName);

    public Token createToken(String userId);
    public Token createToken(String userId, String secretKey);
    public int updateToken(Token token);
    public boolean deleteUserWithToken(String userId);
    public int deleteToken(String userId);


    public String createDigest(String secretKey,String userName);
    public void updateTokeTime(String tokenStr);
}
